package com.yang.springcloudalibaba.service;

import com.yang.springcloud.pojo.Student;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.PostMapping;

import java.util.List;
import java.util.Map;

@FeignClient(name = "nacos-provider-student", fallbackFactory = AlibabaClientServiceFallback.class)
public interface StudentClientService {

    @PostMapping("/insert")
    public Map<String, Object> addStudent(Student s);

    @PostMapping("/delete")
    public Map<String, Object> delereStudent(String name);

    @PostMapping("/update")
    public Map<String, Object> updateStudent(Student s);

    @GetMapping("/query")
    public List<Student> queryAll();

    @GetMapping("/queryById/{passid}")
    public Student queryById(@PathVariable("passid") String passid);

}
